Page({
  onShareAppMessage() {
    return {
      title: '获取用户信息',
      path: 'page/API/pages/get-user-info/get-user-info',
    };
  },

  data: {
    hasUserInfo: false,
  },
  getUserInfo(info) {
    const { userInfo } = info.detail;
    this.setData({
      userInfo,
      hasUserInfo: true,
    });
  },
  clear() {
    this.setData({
      hasUserInfo: false,
      userInfo: {},
    });
  },
});
